package com.basic;

import com.frame.struts.BaseBean;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;
import com.utils.*;
import java.util.Date;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class HeaderResumeForm extends BaseBean {
	
	
	
	public HeaderResumeForm() {
    }
	HeaderResumeEntity hre = new HeaderResumeEntity();
	//private String oldId="";
	
	
	public String addHeaderResume()
	{
		HttpServletRequest request = ActionContext.getActionContext().
		getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
		getResponse();
		BasicFactory factory = new BasicFactory();
		hre.setOptdate(new Date());
		hre.setOptrid(CommUtil.getUserId(request));
		this.setXh(BasicFactory.getMaxVal("qy_gzjl", "xh"));
		try{
			if(factory.addHeaderResume(hre))
			{
				response.sendRedirect(request.getContextPath()+"/gudong/queryHeaderResume.jsp?ryid="+hre.getRyid());
			}else
			{
				response.sendRedirect(request.getContextPath()+"/failed.jsp");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		return null;
	}
	
	public String modifyHeaderResume()
	{
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		hre.setOptdate(new Date());
		hre.setOptrid(CommUtil.getUserId(request));
		factory.deleteHeaderResume(hre.getRyid(),hre.getXh());
		this.setXh(BasicFactory.getMaxVal("qy_gzjl", "xh"));
		try{
			if(factory.addHeaderResume(hre))
			{
				response.sendRedirect(request.getContextPath()+"/gudong/queryHeaderResume.jsp?ryid="+hre.getRyid());
			}else
			{
				response.sendRedirect(request.getContextPath()+"/failed.jsp");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		return null;
	}
	

    public int getXh() {
		return hre.getXh();
	}

	public void setXh(int xh) {
		this.hre.setXh(xh) ;
	}

	/**
	 * @return hre.getReturns the cydw.
	 */
	public String getCydw() {
		return hre.getCydw();
	}
	/**
	 * @param cydw The cydw to set.
	 */
	public void setCydw(String cydw) {
		hre.setCydw(cydw);
	}
	/**
	 * @return hre.getReturns the cysj.
	 */
	public String getCysj() {
		return hre.getCysj();
	}
	/**
	 * @param cysj The cysj to set.
	 */
	public void setCysj(String cysj) {
		hre.setCysj(cysj);
	}
	/**
	 * @return hre.getReturns the drzw.
	 */
	public String getDrzw() {
		return hre.getDrzw();
	}
	/**
	 * @param drzw The drzw to set.
	 */
	public void setDrzw(String drzw) {
		hre.setDrzw(drzw);
	}
	/**
	 * @return hre.getReturns the optdate.
	 */
	public Date getOptdate() {
		return hre.getOptdate();
	}
	/**
	 * @param optdate The optdate to set.
	 */
	public void setOptdate(Date optdate) {
		hre.setOptdate(optdate);
	}
	/**
	 * @return hre.getReturns the optrid.
	 */
	public String getOptrid() {
		return hre.getOptrid();
	}
	/**
	 * @param optrid The optrid to set.
	 */
	public void setOptrid(String optrid) {
		hre.setOptrid(optrid);
	}
	/**
	 * @return hre.getReturns the recstate.
	 */
	public String getRecstate() {
		return hre.getRecstate();
	}
	/**
	 * @param recstate The recstate to set.
	 */
	public void setRecstate(String recstate) {
		hre.setRecstate(recstate);
	}
	/**
	 * @return hre.getReturns the remark.
	 */
	public String getRemark() {
		return hre.getRemark();
	}
	/**
	 * @param remark The remark to set.
	 */
	public void setRemark(String remark) {
		hre.setRemark(remark);
	}
	/**
	 * @return hre.getReturns the ryid.
	 */
	public int	getRyid() {
		return hre.getRyid();
	}
	/**
	 * @param ryid The ryid to set.
	 */
	public void setRyid(int ryid) {
		hre.setRyid(ryid);
	}

}